package com.cyy.springbootinit.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.cyy.springbootinit.common.BaseResponse;
import com.cyy.springbootinit.model.dto.balanceAlarm.BalanceAlarmQueryRequest;
import com.cyy.springbootinit.model.entity.BalanceAlarm;
import com.cyy.springbootinit.model.vo.BalanceAlarmVO;

import javax.servlet.http.HttpServletRequest;

/**
 * 余额报警记录表服务
 *
 * @author 程序员cyy</a>
 * @from cyy</a>
 */
public interface BalanceAlarmService extends IService<BalanceAlarm> {

    /**
     * 校验数据
     *
     * @param balanceAlarm
     * @param add 对创建的数据进行校验
     */
    void validBalanceAlarm(BalanceAlarm balanceAlarm, boolean add);

    /**
     * 获取查询条件
     *
     * @param balanceAlarmQueryRequest
     * @return
     */
    QueryWrapper<BalanceAlarm> getQueryWrapper(BalanceAlarmQueryRequest balanceAlarmQueryRequest);
    
    /**
     * 获取余额报警记录表封装
     *
     * @param balanceAlarm
     * @param request
     * @return
     */
    BalanceAlarmVO getBalanceAlarmVO(BalanceAlarm balanceAlarm, HttpServletRequest request);

    /**
     * 分页获取余额报警记录表封装
     *
     * @param balanceAlarmPage
     * @param request
     * @return
     */
    Page<BalanceAlarmVO> getBalanceAlarmVOPage(Page<BalanceAlarm> balanceAlarmPage, HttpServletRequest request);

    Long getBalanceAlarmCountByDormitoryId(Integer dormitoryId);
}
